Ext.namespace('Ext.xredman');

//将一组构造参数放在一个对象中
Ext.xredman.Person = function(_cfg){
	//alert(_cfg);
	Ext.apply(this, _cfg);
}

Ext.xredman.Person.print = function(_name, _sex) {
	var _person = new Ext.xredman.Person({name:_name, sex:_sex});
	_person.print();
}

Ext.apply(Ext.xredman.Person.prototype,{
	print:function(){
		alert(String.format('姓名:{0},性别:{1}',this.name, this.sex));
	}
});

//Sample
var _person = new Ext.xredman.Person.print('xredman','man');
//alert(_person.name);
/**
 * Java代码对照
 * public Person(String name, String sex){
 * 	this.name = name;
 * 	this.sex = sex;
 * }
 */